from myelin.Ns import MYELIN
from myelin.rdf.bindery.ObjectTypes import LiteralTypeO, ResourceTypeO

from Document import Document

from ObjectTypes import \
    NodeGroupingTypeO, NodeGroupingTypeS, \
    ContainerTypeS

from mappings import \
    NodeGroupingMap, \
    DocContainedByMap, \
    DocTranslationMap, \
    DocTranslationOfMap

class NodeGrouping(Document):
    
    ModelTypes = (NodeGroupingTypeO, NodeGroupingTypeS)
    
    RDF_BINDINGS = {
        'mMax_Display_Count'    : ((MYELIN, 'max-display-count'), LiteralTypeO, NodeGroupingMap),
        'mOrder_By'             : ((MYELIN, 'order-by'), LiteralTypeO, NodeGroupingMap),
        'mOrder_Direction'      : ((MYELIN, 'order-direction'), LiteralTypeO, NodeGroupingMap),
        'mMax_Display_Count'    : ((MYELIN, 'max-display-count'), LiteralTypeO, NodeGroupingMap),
        'mPermitted_Type'       : ((MYELIN, 'permitted-type'), ResourceTypeO, NodeGroupingMap), # FIXME: should be OwlClassType
        'mHidden'               : ((MYELIN, 'hidden'), LiteralTypeO, NodeGroupingMap),
        'mParentGrouping'       : ((MYELIN, 'contains-grouping'), ContainerTypeS, DocContainedByMap),
            
        'mTranslation'          : ((MYELIN, 'translation'), NodeGroupingTypeO, DocTranslationMap),
        'mTranslation_Of'       : ((MYELIN, 'translation'), NodeGroupingTypeS, DocTranslationOfMap),
            
        'mParent'               : ['mParentGrouping',]
    }

    
CLASS_TYPES = {
    MYELIN + 'NodeGrouping' : NodeGrouping,
}